using System;
using Piece = System.Int32;
//---------------------------------------------------------------------------//
//																			 //
//			r  n  C  h  e  s  s  B  o  a  r  d  C  o  n  t  r  o  l			 //
//			=======================================================			 //
//						  (c) 2003 Chris R. Chapman							 //
//																			 //
//	Version:		1.0	Full												 //
//  Date:			May 2003												 //
//  Author:			Chris R. Chapman (chris@chapmanconsulting.ca)			 //
//  Description:	A chessboard GUI written in 100% .Net/C#, featuring		 //
//					a resizable board with adjustable colors and configurable//
//					images for pieces, as well as events for capturing player//
//					movement and illegal moves.								 //
//																			 //
//																			 //
// LICENSING:		Can be freely distributed and used as long as the		 //
//					following criteria are met:								 //
//																			 //
//					1) All copyright notices are kept intact;				 //
//					2) Product is not for commercial resale;				 //
//					3) Product is NOT used in conjunction with ANY GPLed or  //
//					   FSF software.  I cannot abide by their philosophies.  //
//					4) Credit for the control to me is made in some			 //
//					   conspicuous fashion, like an About box.				 //
//---------------------------------------------------------------------------//
namespace RNChessBoardCommonTypes
{

	/// <summary>
	/// Player side identification.
	/// </summary>
	public enum PlayerTurn
	{
		White,Black
	}

	/// <summary>
	/// Move result description.
	/// </summary>
	public enum MoveResult
	{
		/// <summary>
		/// Indicates that the move made was verified as legal for the rules of chess.
		/// </summary>
		LEGAL,
		/// <summary>
		/// Indicates that the move made was verified as illegal for the rules of chess.
		/// </summary>
		ILLEGAL,
		/// <summary>
		/// Indicates that the move made resulted in the opposing king being placed in check.
		/// </summary>
		CHECK,
		/// <summary>
		/// Indicates that the move made resulted in the opposing king being placed in checkmate.
		/// </summary>
		MATE,
	}

	/// <summary>
	/// Move type description.
	/// </summary>
	public enum MoveType
	{
		/// <summary>
		/// Indicates a non-capturing move.
		/// </summary>
		NONCAPTURE,
		/// <summary>
		/// Indicates a move that captures an opposing piece.
		/// </summary>
		CAPTURE,
		/// <summary>
		/// Indicates an en passant pawn capture.
		/// </summary>
		ENPASSANT,
		/// <summary>
		/// Indicates castling.
		/// </summary>
		CASTLING,
		/// <summary>
		/// Indicates a short or king-side castle.
		/// </summary>
		KINGSIDE_CASTLE,
		/// <summary>
		/// Indicates a long or queen-side castle.
		/// </summary>
		QUEENSIDE_CASTLE,
		/// <summary>
		/// Indicates a pawn movement to eighth rank resulting in piece promotion.
		/// </summary>
		PROMOTION,
		/// <summary>
		/// Indicates an illegal move.
		/// </summary>
		ILLEGAL
	}

	/// <summary>
	/// Datatype that defines the result of a player's move.
	/// </summary>
	public struct PlayerMoveResult
	{
		/// <summary>
		/// Piece color for player that made move.
		/// </summary>
		public PlayerTurn PlayerSide;
		/// <summary>
		/// Piece that the player moved.
		/// </summary>
		public Piece PlayerPiece;
		/// <summary>
		/// Originating square (0-63) that the piece moved from.
		/// </summary>
		public int MoveFrom;
		/// <summary>
		/// Destination square (0-63) that the piece moved toward.
		/// </summary>
		public int MoveTo;
		/// <summary>
		/// Originating square that the piece moved from in Standard Algebraic Notation.
		/// </summary>
		public string MoveFromSAN;
		/// <summary>
		/// Destination square that the piece moved toward in Standard Algebraic Notation.
		/// </summary>
		public string MoveToSAN;
		/// <summary>
		/// Status of the move after it was taken.
		/// </summary>
		public MoveResult PlayerMoveStatus;
		/// <summary>
		/// Type of move the player made, ie capturing, non-capturing, etc.
		/// </summary>
		public MoveType PlayerMoveType;
		/// <summary>
		/// The Standard Algebraic Notation for the player's move.
		/// </summary>
		public string MoveSAN;
		/// <summary>
		/// Pawn promotion piece, if any.
		/// </summary>
		public Piece PromotedPiece;
	}
}
